package main

import (
	"fmt"
	"math"
)

type people struct {
	name string
	age  int
}

type Vertex struct {
	X, Y float64
}

func (v Vertex) Abs() float64 {
	return math.Sqrt(v.X*v.X + v.Y*v.Y)
}
func (v Vertex) test1() {
	v.X++
	v.Y++
}

//	func (v *Vertex) test2() {
//		v.X++
//		v.Y++
//	}
func main() {
	ming := new(people)
	ming.name = "xiao ming"
	ming.age = 18

	ming2 := &people{"xiao ming", 18}

	fmt.Println(ming)
	fmt.Println(ming2)

	v := Vertex{3, 4}
	fmt.Println(v.Abs())
}
